<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@page import="org.quickbundle.project.RmGlobalReference"%>
<%@ page import="org.quickbundle.tools.helper.RmVoHelper"%>
<%@ page import="org.quickbundle.tools.helper.RmStringHelper"%>
<%@ page
	import="org.quickbundle.orgauth.rmfunctionnode.vo.RmFunctionNodeVo"%>
<%@ page import="org.quickbundle.tools.helper.RmStringHelper" %>
<%@ page
	import="org.quickbundle.orgauth.rmfunctionnode.util.IRmFunctionNodeConstants"%>
<%@page import="org.quickbundle.orgauth.IOrgauthConstants"%>
<%@page import="com.dfhc.util.CryptoHelper"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<%-- <%@ include file="/jsp/include/rmGlobal.jsp" %> --%>

<%@ taglib uri="/dfhc" prefix="dfhc"%>
<!-- 全局js 和css包 -->
<%@ include file="/jsp/include/web/new/global.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title></title>
</head>
<script type="text/javascript">
	function editToHX(title, url, w, h, id) {
		var neww;
		var newh;
		var newurl =getRootPath()+ url + "?id=" + id;
		if (w.indexOf("%") != -1) {
			neww = w;
		} else {
			neww = w + 'px';
		}
		if (h.indexOf("%") != -1) {
			newh = h;
		} else {
			newh = h + 'px';
		}
		layer.open({
			type : 2,
			area : [ neww, newh ],
			fix : true,
			shade : 0.4,
			title : title,
			content : newurl,
			maxmin : true,
			cancel : function() {
				window.location.reload();
			}
		});
	}
	function deleteToHX(url, id) {
		debugger;
		var newUrl =getRootPath()+ url + "?id=" + id +'&total_code='+${bean.total_code};
		//url后面自动带jsguid
		if(url.indexOf("jsguid")==-1){
			 if(url.indexOf("?")==-1){
				   url = url+"?jsguid="+__global_guid;
			 }else{
				   url = url+"&jsguid="+__global_guid;
			 }
		}
		//url 后面自动带csrf 编码
		if(!isStrEmpty($('#_csrfcode_').val())){
			if (url.indexOf("?") == -1) {
				url = url + "?_csrfcode_=" + $('#_csrfcode_').val();
			} else {
				url = url + "&_csrfcode_=" + $('#_csrfcode_').val();
			}
		}
		layer.confirm('确认要删除吗？', function(index) {
			$.ajax({
				type : 'POST',
				url : newUrl,
				dataType : 'json',
				success : function(data) {
					//$(obj).parents("tr").remove();
					layer.msg('已删除!', {
						icon : 1,
						time : 1000
					});
					$('.iframe_table').DataTable().ajax.reload();
				},
				error : function(data) {
					console.log(data.msg);
				},
			});
		});
	}
	function newAddToHX(title,url, w, h, id) {
		debugger;
		var neww;
		var newh;
		var parent_total_code = '${bean.total_code}';
		var newurl =getRootPath()+ url + "?id=" + id + "&parent_total_code="+ parent_total_code;
		if (w.indexOf("%") != -1) {
			neww = w;
		} else {
			neww = w + 'px';
		}
		if (h.indexOf("%") != -1) {
			newh = h;
		} else {
			newh = h + 'px';
		}
		layer.open({
			type : 2,
			area : [ neww, newh ],
			fix : true,
			shade : 0.4,
			title : title,
			content : newurl,
			maxmin : true,
			cancel : function() {
				window.location.reload();
			}
		});
	}
</script>
<body>
	<form name="form" method="post">
		<br />
		<article class="page-container">

		<form action="" method="post" class="form form-horizontal"
			id="form-member-add">
			<input type="hidden" id="id" name="id" value="${bean.id}"> <dfhc:div
					templateId="h_ui_div_row_cl">
					<dfhc:title templateId="h_ui_label_title"><%=IRmFunctionNodeConstants.TABLE_COLUMN_CHINESE.get("name")%>:</dfhc:title>
					<dfhc:div templateId="h_ui_div_fromcontrol">
						<dfhc:input templateId="h_ui_input" value="${bean.name}" id="name"
							name="name" readonly="true" />
					</dfhc:div>
				</dfhc:div> <dfhc:div templateId="h_ui_div_row_cl">
					<dfhc:title templateId="h_ui_label_title"><%=IRmFunctionNodeConstants.TABLE_COLUMN_CHINESE.get("enable_status")%>:</dfhc:title>
					<dfhc:div templateId="h_ui_div_fromcontrol">
						<dfhc:select templateId="h_ui_select" size="1"
							name="enable_status" readonly="true" id="enable_status"
							pleaseSelect="1" defaultValue="${bean.enable_status}"
							sqlOption="code"
							code="<%=IRmFunctionNodeConstants.DICTIONARY_RM_LOCK_STATUS%>" />
					</dfhc:div>
				</dfhc:div> <dfhc:div templateId="h_ui_div_row_cl">
					<dfhc:title templateId="h_ui_label_title"><%=IRmFunctionNodeConstants.TABLE_COLUMN_CHINESE.get("description")%>:</dfhc:title>
					<dfhc:div templateId="h_ui_div_fromcontrol">
						<dfhc:textarea templateId="h_ui_input" value="${bean.description}"
							id="description" name="description" readonly="true"></dfhc:textarea>
					</dfhc:div>
				</dfhc:div> <dfhc:div templateId="h_ui_div_row_cl">
					<dfhc:title templateId="h_ui_label_title"><%=IRmFunctionNodeConstants.TABLE_COLUMN_CHINESE.get("data_value")%>:</dfhc:title>
					<dfhc:div templateId="h_ui_div_fromcontrol">
						<dfhc:input templateId="h_ui_input" value="${bean.data_value}"
							id="data_value" name="data_value" readonly="true" />
					</dfhc:div>
				</dfhc:div> <dfhc:div templateId="h_ui_div_row_cl">
					<dfhc:title templateId="h_ui_label_title"><%=IRmFunctionNodeConstants.TABLE_COLUMN_CHINESE.get("is_leaf")%>:</dfhc:title>
					<dfhc:div templateId="h_ui_div_fromcontrol">
						<dfhc:select templateId="h_ui_select" size="1" name="lockStatus"
							id="lockStatus" readonly="true" pleaseSelect="1"
							defaultValue="${bean.is_leaf}" sqlOption="code"
							code="<%=IRmFunctionNodeConstants.DICTIONARY_RM_YES_NOT%>" />
					</dfhc:div>
				</dfhc:div> <dfhc:div templateId="h_ui_div_row_cl">
					<dfhc:span templateId="h_ui_button_span">
						<dfhc:button templateId="h_ui_update_button"
							onclick="editToHX('修改','/rmFunctionNode/showPage','800','750','${bean.id}')" />
						<dfhc:button templateId="h_ui_delete_button"
							onclick="deleteToHX('/rmFunctionNode/deleteToHX','${bean.id}')" />
						<dfhc:button templateId="h_ui_newadd_button"
							onclick="newAddToHX('新建菜單','/rmFunctionNode/newAddToHX','800','750','${bean.id}')" />
					</dfhc:span>
				</dfhc:div>
		</form>
<dfhc:input type="hidden" name="id" value="${bean.id}" />
<dfhc:input type="hidden" name="total_code" value="${bean.total_code }" />
<dfhc:input type="hidden" name="data_value" value="${bean.data_value }" />
		</article>
	</form>
	<iframe width="100%" height="500" frameBorder="0"
		src='<%=request.getContextPath()%><%=CryptoHelper.encryptUrl(request,"/project/authorize/newMasterAuthority.jsp")%>?bs_keyword=<%=IOrgauthConstants.Authorize.FUNCTION_NODE.bsKeyword()%>&old_resource_id=${bean.total_code}'></iframe>
</body>
</html>